package D2;

import java.io.IOException;

public class Java01 {
    public static void main(String[] args) throws IOException, InterruptedException {
        //常用API之math
//        System.out.println(Math.abs(100));
//        System.out.println(Math.abs(-19));
//        System.out.println(Math.ceil(5.1));
//        System.out.println(Math.ceil(4.9));
//        System.out.println(Math.floor(4.9));
//        System.out.println(Math.floor(5.1));
//        System.out.println(Math.floor(-10.1));
//        System.out.println(Math.round(5.1));
//        System.out.println(Math.round(9.7));
//        System.out.println(Math.pow(9,10));
//        System.out.println(Math.pow(2,1024));
//        System.out.println(Math.random());
        //常用API之system
        //System.exit(0);
//        long time = System.currentTimeMillis();
//        System.out.println(time);
//        for (int i = 0; i < 1000000; i++) {
//            System.out.println("输出了："+i);
//        }
//        long time2 = System.currentTimeMillis();
//        System.out.println((time2 - time) / 1000.0+"s");
        Runtime r = Runtime.getRuntime();
        System.out.println(r.availableProcessors());
        System.out.println(r.totalMemory()/1024/1024+"MB");
        System.out.println(r.freeMemory()/1024/1024+"MB");
        Process p = r.exec("cmd");
        Thread.sleep(5000);
        p.destroy();
    }
}
